import { defineStore } from "pinia";
import api from "@/api";

const doctorRoleStore = defineStore("doctorEole", {
  state: () => {
    return {
      doctorRoleList: [],
    };
  },
  getters: {},
  actions: {
    getAllRoleData: async function () {
      const result = await api.ysAdmin.getAllRoleApi();
      this.doctorRoleList = result.data.data;
      console.log(this.doctorRoleList);
    },
  },
  persist: {
    enabled: true,
    strategies: [
      {
        key: "doctorEole",
        storage: localStorage,
      },
    ],
  },
});

export default doctorRoleStore;
